const phone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
const email = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/

// 手机号验证
export const validatorPhone = (val) => {
    return phone.test(val);
}

// 
export const validatorEmail = (val) => {
    return email.test(val);
}

export const rules = () => (
    {
        ruleName: [{ required: true, message: "请输入信访人姓名" }],
        ruleAddress: [{ required: true, message: "请输入信访人地址" }],
        ruleName: [{ required: true, message: "请输入姓名" }],
        ruleAddress: [{ required: true, message: "请输入地址" }],
        rulePhone: [
            { required: true, message: "请输入电话" },
            { validator: validatorPhone, message: "请输入正确电话号码" },
        ],
        ruleEmail: [
            { required: true, message: "请输入电子邮箱" },
            { validator: validatorEmail, message: "请输入正确电子邮箱" },
        ],
        ruleType: [{ required: true, message: "请选择信访类型" }],
        ruleSelect: [{ required: true, message: "请选择案件选择方式" }],
        rulePassword: [{ required: true, message: "请输入诉讼服务密码" }],
        ruleSms: [{ required: true, message: "请输入验证码" }],
        ruleCourt:[{required:true,message:"请选择法院"}],
        ruleFontSize:[{required:true,message:"请选择案号"}],
        ruleCaseNumber:[{required:true,message:"请输入相关案号"}],
        ruleUserType:[{ required: true, message: '请选择信访人身份' }],
        ruleRelation:[{required:true,message:"请选择关系"}],
        ruleSketch:[{ required: true, message: '请输入诉求与事实简述' }],
        ruleCaseReason:[{ required: true, message: '请填写案由' }],
        ruleSupervised:[{ required: true, message: '请输入被监督人'}],
        ruleIsProblem:[{ required: true, message: '请选择是否存在问题'}],
        ruleYearNum:[{ required: true, message:'请输入案件年度号'}],
        ruleWordNum:[{ required: true, message:'请输入案件字号'}],
        ruleSerialNum:[{ required: true, message:'请输入案件编号'}],
        ruleSugContent:[{ required: true, message: "请输入建议内容" }]

    }
)


